package com.yz.group1.group_1.service.impl;

import com.yz.group1.group_1.entity.Hospitalization2;
import com.yz.group1.group_1.mapper.Hospitalization2Mapper;
import com.yz.group1.group_1.service.Hospitalization2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Hospitalization22ServiceImpl implements Hospitalization2Service {

    @Autowired
    private Hospitalization2Mapper hospitalization2Mapper;

    @Override
    public List<Hospitalization2> listAll() {
        return hospitalization2Mapper.selectList(null);
    }

    @Override
    public boolean update(Hospitalization2 hospitalization2) {
        return hospitalization2Mapper.updateById(hospitalization2) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return hospitalization2Mapper.deleteById(id) > 0;
    }

    @Override
    public boolean add(Hospitalization2 hospitalization2) {
        return hospitalization2Mapper.insert(hospitalization2) > 0;
    }
}